
/////////////////////////////////////
*-- Robustness Agriculture
/////////////////////////////////////


reg primary50_individual bartik_standardized i.laani50 , cl(muni39_g)
estadd local sample "All"

estadd local mfe "None"
estadd local rfe "\checkmark"
estadd local indi ""
sum primary50_individual 
estadd scalar ymean=r(mean)
estadd scalar ysd=r(sd)
estimates store p1


reghdfe primary50_individual bartik_standardized $municontrols , a(fem byear laani50) cl(muni39_g)

estadd local sample "All"
estadd local mfe "Baseline"
estadd local rfe "\checkmark"
estadd local indi "\checkmark"
sum primary50_individual 
estadd scalar ymean=r(mean)
estadd scalar ysd=r(sd)
estimates store p2


reghdfe primary50_individual bartik_standardized $lasso , a(fem byear laani50) cl(muni39_g)
estadd local sample "All"

estadd local mfe "Lasso"
estadd local rfe "\checkmark"
estadd local indi "\checkmark"
sum primary50_individual 
estadd scalar ymean=r(mean)
estadd scalar ysd=r(sd)
estimates store p3


reghdfe primary50_individual bartik_standardized  i.manu_quartile i.agri_quartile  town city ,  a(fem byear laani50) cl(muni39_g)
estadd local sample "All"

estadd local mfe "Baseline groups"
estadd local rfe "\checkmark"
estadd local indi "\checkmark"
sum primary50_individual 
estadd scalar ymean=r(mean)
estadd scalar ysd=r(sd)
estimates store p5


reghdfe primary50_individual bartik_high $municontrols , a(fem byear laani50) cl(muni39_g)
estadd local sample "All"

estadd local mfe "Baseline"
estadd local rfe "\checkmark"
estadd local indi "\checkmark"
sum primary50_individual 
estadd scalar ymean=r(mean)
estadd scalar ysd=r(sd)
estimates store p6

reghdfe primary50_individual bartikq2 bartikq3 bartikq4 $municontrols , a(fem byear laani50) cl(muni39_g)
estadd local sample "All"

estadd local mfe "Baseline"
estadd local rfe "\checkmark"
estadd local indi "\checkmark"
sum primary50_individual 
estadd scalar ymean=r(mean)
estadd scalar ysd=r(sd)
estimates store p7


reg primary50_individual bartik_standardized i.laani50 if primary39==1, cl(muni39_g)
estadd local sample "Agriculture 1939"

estadd local mfe "None"
estadd local rfe "\checkmark"
estadd local indi ""
sum primary50_individual if primary39==1
estadd scalar ymean=r(mean)
estadd scalar ysd=r(sd)
estimates store p8


reghdfe primary50_individual bartik_standardized $municontrols if primary39==1, a(fem byear laani50) cl(muni39_g)

estadd local sample "Agriculture 1939"
estadd local mfe "Baseline"
estadd local rfe "\checkmark"
estadd local indi "\checkmark"
sum primary50_individual if primary39==1
estadd scalar ymean=r(mean)
estadd scalar ysd=r(sd)
estimates store p9


reghdfe primary50_individual bartik_standardized $lasso if primary39==1, a(fem byear laani50) cl(muni39_g)
estadd local sample "Agriculture 1939"

estadd local mfe "Lasso"
estadd local rfe "\checkmark"
estadd local indi "\checkmark"
sum primary50_individual if primary39==1
estadd scalar ymean=r(mean)
estadd scalar ysd=r(sd)
estimates store p10



reghdfe primary50_individual bartik_standardized  i.manu_quartile i.agri_quartile  town city if primary39==1,  a(fem byear laani50) cl(muni39_g)
estadd local sample "Agriculture 1939"

estadd local mfe "Baseline groups"
estadd local rfe "\checkmark"
estadd local indi "\checkmark"
sum primary50_individual if primary39==1
estadd scalar ymean=r(mean)
estadd scalar ysd=r(sd)
estimates store p12


reghdfe primary50_individual bartik_high $municontrols if primary39==1, a(fem byear laani50) cl(muni39_g)
estadd local sample "Agriculture 1939"

estadd local mfe "Baseline"
estadd local rfe "\checkmark"
estadd local indi "\checkmark"
sum primary50_individual if primary39==1
estadd scalar ymean=r(mean)
estadd scalar ysd=r(sd)
estimates store p13

reghdfe primary50_individual bartikq2 bartikq3 bartikq4 $municontrols if primary39==1, a(fem byear laani50) cl(muni39_g)
estadd local sample "Agriculture 1939"

estadd local mfe "Baseline"
estadd local rfe "\checkmark"
estadd local indi "\checkmark"
sum primary50_individual if primary39==1
estadd scalar ymean=r(mean)
estadd scalar ysd=r(sd)
estimates store p14

label var bartik_high "Bartik high"
label var bartikq2 "Bartik q2"
label var bartikq3 "Bartik q3"
label var bartikq4 "Bartik q4"


esttab p1 p2 p3 p5 p6 p7 p8 p9 p10 p12 p13 p14 ///
using "$temp\tables\agri_1950_robustness.tex", ///
mgroups("Agriculture in 1950", pattern(1 0 0 0 0 0 0 0 0 0 0 0 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) ///
span erepeat(\cmidrule(lr){@span}) ) ///
replace keep(bartik_standardized bartik_high bartikq2 bartikq3 bartikq4) nonotes ///
b(%9.3f) se(%9.3f)  stats(N sample  ymean mfe rfe indi , fmt(0 3) layout(@ @ @) ///
labels("N" "Sample"  "Y mean" "Municipal controls" "Region Fes" "Individual controls")) label star(* .1 ** .05 *** .01) nodepvars nomtitle


est clear


/////////////////////////////////////
*-- Robustness Manufacturing
/////////////////////////////////////


reg manufacturing_50 bartik_standardized i.laani50 , cl(muni39_g)
estadd local sample "All"

estadd local mfe "None"
estadd local rfe "\checkmark"
estadd local indi ""
sum manufacturing_50 
estadd scalar ymean=r(mean)
estadd scalar ysd=r(sd)
estimates store p1


reghdfe manufacturing_50 bartik_standardized $municontrols , a(fem byear laani50) cl(muni39_g)

estadd local sample "All"
estadd local mfe "Baseline"
estadd local rfe "\checkmark"
estadd local indi "\checkmark"
sum manufacturing_50 
estadd scalar ymean=r(mean)
estadd scalar ysd=r(sd)
estimates store p2


reghdfe manufacturing_50 bartik_standardized $lasso , a(fem byear laani50) cl(muni39_g)
estadd local sample "All"

estadd local mfe "Lasso"
estadd local rfe "\checkmark"
estadd local indi "\checkmark"
sum manufacturing_50 
estadd scalar ymean=r(mean)
estadd scalar ysd=r(sd)
estimates store p3



reghdfe manufacturing_50 bartik_standardized  i.manu_quartile i.agri_quartile  town city ,  a(fem byear laani50) cl(muni39_g)
estadd local sample "All"

estadd local mfe "Baseline groups"
estadd local rfe "\checkmark"
estadd local indi "\checkmark"
sum manufacturing_50 
estadd scalar ymean=r(mean)
estadd scalar ysd=r(sd)
estimates store p5


reghdfe manufacturing_50 bartik_high $municontrols , a(fem byear laani50) cl(muni39_g)
estadd local sample "All"

estadd local mfe "Baseline"
estadd local rfe "\checkmark"
estadd local indi "\checkmark"
sum manufacturing_50 
estadd scalar ymean=r(mean)
estadd scalar ysd=r(sd)
estimates store p6

reghdfe manufacturing_50 bartikq2 bartikq3 bartikq4 $municontrols , a(fem byear laani50) cl(muni39_g)
estadd local sample "All"

estadd local mfe "Baseline"
estadd local rfe "\checkmark"
estadd local indi "\checkmark"
sum manufacturing_50 
estadd scalar ymean=r(mean)
estadd scalar ysd=r(sd)
estimates store p7


reg manufacturing_50 bartik_standardized i.laani50 if primary39==1, cl(muni39_g)
estadd local sample "Agriculture 1939"

estadd local mfe "None"
estadd local rfe "\checkmark"
estadd local indi ""
sum manufacturing_50 if primary39==1
estadd scalar ymean=r(mean)
estadd scalar ysd=r(sd)
estimates store p8


reghdfe manufacturing_50 bartik_standardized $municontrols if primary39==1, a(fem byear laani50) cl(muni39_g)

estadd local sample "Agriculture 1939"
estadd local mfe "Baseline"
estadd local rfe "\checkmark"
estadd local indi "\checkmark"
sum manufacturing_50 if primary39==1
estadd scalar ymean=r(mean)
estadd scalar ysd=r(sd)
estimates store p9


reghdfe manufacturing_50 bartik_standardized $lasso if primary39==1, a(fem byear laani50) cl(muni39_g)
estadd local sample "Agriculture 1939"

estadd local mfe "Lasso"
estadd local rfe "\checkmark"
estadd local indi "\checkmark"
sum manufacturing_50 if primary39==1
estadd scalar ymean=r(mean)
estadd scalar ysd=r(sd)
estimates store p10


reghdfe manufacturing_50 bartik_standardized  i.manu_quartile i.agri_quartile  town city if primary39==1,  a(fem byear laani50) cl(muni39_g)
estadd local sample "Agriculture 1939"

estadd local mfe "Baseline groups"
estadd local rfe "\checkmark"
estadd local indi "\checkmark"
sum manufacturing_50 if primary39==1
estadd scalar ymean=r(mean)
estadd scalar ysd=r(sd)
estimates store p12


reghdfe manufacturing_50 bartik_high $municontrols if primary39==1, a(fem byear laani50) cl(muni39_g)
estadd local sample "Agriculture 1939"

estadd local mfe "Baseline"
estadd local rfe "\checkmark"
estadd local indi "\checkmark"
sum manufacturing_50 if primary39==1
estadd scalar ymean=r(mean)
estadd scalar ysd=r(sd)
estimates store p13

reghdfe manufacturing_50 bartikq2 bartikq3 bartikq4 $municontrols if primary39==1, a(fem byear laani50) cl(muni39_g)
estadd local sample "Agriculture 1939"

estadd local mfe "Baseline"
estadd local rfe "\checkmark"
estadd local indi "\checkmark"
sum manufacturing_50 if primary39==1
estadd scalar ymean=r(mean)
estadd scalar ysd=r(sd)
estimates store p14

label var bartik_high "Bartik high"
label var bartikq2 "Bartik q2"
label var bartikq3 "Bartik q3"
label var bartikq4 "Bartik q4"



esttab p1 p2 p3 p5 p6 p7 p8 p9 p10 p12 p13 p14 ///
using "$temp\tables\manu_1950_robustness.tex", ///
mgroups("Manufacturing 1950", pattern(1 0 0 0 0 0 0 0 0 0 0 0 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) ///
span erepeat(\cmidrule(lr){@span}) ) ///
replace keep(bartik_standardized bartik_high bartikq2 bartikq3 bartikq4) nonotes ///
b(%9.3f) se(%9.3f)  stats(N sample  ymean mfe rfe indi , fmt(0 3) layout(@ @ @) ///
labels("N" "Sample"  "Y mean" "Municipal controls" "Region Fes" "Individual controls")) label star(* .1 ** .05 *** .01) nodepvars nomtitle


est clear
